// 引入路由
import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import LoginView from '../views/LoginView.vue'
import DengLuView from '../views/DengLuView.vue'
// 创建路由方法
const router = createRouter({
  // 路由历史记录模式
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',  // 默认路由路径  项目中只有一个默认路由
      name: 'home',
      component: HomeView
    },
    {
      path: '/about',
      name: 'about',
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import('../views/AboutView.vue')
    },
    {
      path: '/login',
      name: 'login',
      component: LoginView
    },
    {
      path: '/denglu',
      name: 'denglu',
      component: DengLuView
    }
  ]
})

export default router
